package com.zhuxiang.test1;

import java.util.Scanner;

/**
 * 五子棋测试类
 */
public class GobangTest {
    public static String white = "白方";
    public static String black = "黑方";
    public static boolean color = true;
    public static String spoint;
    public static void main(String[] args) {
        Gobang gobang = new Gobang();
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("请" + (color ? white:black) + "落子："+"(格式如下：1 1)");
            spoint = sc.nextLine();
            Point point = gobang.getPoint(spoint);
            if (gobang.playChess(point,color)){
                gobang.print();
                if (gobang.isWin(point,color)){
                    System.out.println(""+(color?white:black)+"赢了！");
                    break;
                }
                color=!color;
            }
        }
    }
}
